﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Text;
using System.Collections;

using System.Data.OracleClient;
using Xiaov.SmartWeb.Application.SupCan;

namespace Xiaov.SmartWeb.Application.HXZB.Tzfx
{
    public partial class ZjmxData : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string jh = Request.QueryString["jh"];
            string nf = Request.QueryString["nf"];
            if (nf != null && jh != null)
            {
                string dataString = ConfigurationManager.AppSettings["Zjmx_Column"];
                string sql = "select " + dataString + @",case when jshgs='1' then '是' else '否' end jshgs,case when gjks='1' then '是' else '否' end gjks,
                    case when jjzq is null then '' else  case when round(jjzq/24/60,0)=0 then '' else TRUNC(jjzq/24/60,0)||'天' end ||round((jjzq/24/60-TRUNC(jjzq/24/60,0))*24,0)||'小时' end jjzq,
                    case when zjzq is null then '' else  case when round(zjzq/24/60,0)=0 then '' else TRUNC(zjzq/24/60,0)||'天' end ||round((zjzq/24/60-TRUNC(zjzq/24/60,0))*24,0)||'小时' end zjzq,
                    case when wjzq is null then '' else  case when round(wjzq/24/60,0)=0 then '' else TRUNC(wjzq/24/60,0)||'天' end ||round((wjzq/24/60-TRUNC(wjzq/24/60,0))*24,0)||'小时' end wjzq 
                    from zjyb_zjyb00 where jh='" + jh + "'";
                DataSet ds = Maticsoft.DBUtility.DbHelperOra.Query(sql);

                #region 输出xml串
                ConvertToXml.Convert(ds.Tables[0], dataString + ",jshgs,gjks,zjzq,jjzq,wjzq", 0, ds.Tables[0].Rows.Count);
                #endregion
            }
        }
    }
}